Skip to content

Honor CLI output formats and reject unsupported snapshot options - #1852

Open
patch-goblin[bot] wants to merge 3 commits into
mainfrom
patch-goblin/slack/20645017-f05b-46ae-9c57-3ddf0c476d48
Open

Honor CLI output formats and reject unsupported snapshot options#1852
patch-goblin[bot] wants to merge 3 commits into
mainfrom
patch-goblin/slack/20645017-f05b-46ae-9c57-3ddf0c476d48

Conversation

@patch-goblin

@patch-goblin patch-goblin Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Request

Fix the ignored CLI flags reported in #1748.

Closes #1748.

Changes

  • Honor explicit --format and configured JSON/YAML/table output for kcl bounding-box, preserving the existing row structure and unit conversions.
  • Honor format selection for api-call status, including completed file conversions. Keep download notices on stderr for structured output and omit already-saved base64 payloads. Render real API status fields in table mode rather than the SDK enum's variant-only table.
  • Remove the unused --format flags from kcl export, kcl snapshot, and kcl view; their actual CAD/image --output-format options are unchanged.
  • Reject session snapshot rendering options the current session protocol cannot represent (--angle, --camera-style, --camera-padding, --replay, --allow-errors, --show-trace). Reject non-PNG output, whether explicit or inferred, before reading the input or contacting the session. Preserve inferred and explicit PNG snapshots with the server's fixed rendering settings.

Validation

Using the repository's pinned Nix development shell (Rust 1.98.1):

  • cargo test --locked --test output_formats: six tests pass, exercising the real CLI against local HTTP/WebSocket servers. Covers format/config precedence, unit conversion, status fields, completed downloads, unsupported flags, and PNG session behavior.
  • Regression proof on original main: five expected failures; the supported PNG control passed. Both independent reviewers inspected the code and before/after results; their table-rendering finding was fixed and covered by stronger assertions.
  • cargo clippy --locked --all-features --all-targets -- -D warnings: passes (the repository's just lint command, with a locked dependency graph).
  • cargo fmt -- --check and git diff --check: pass.

Compatibility and limits

Previously ignored switches now fail explicitly. api-call status now honors the normal configured/default format (table); callers requiring JSON should request --format json. Custom rendering and JPEG remain available without --session; no session-server protocol or dependency changes are needed.

Validation uses local protocol fixtures, not a live modeling engine. No merge or deployment is included.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.79%. Comparing base (469c661) to head (d8e88dd).

Files with missing lines Patch % Lines
src/cmd_api_call.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1852      +/-   ##
==========================================
+ Coverage   66.18%   66.79%   +0.61%     
==========================================
  Files          43       43              
  Lines        8451     8456       +5     
==========================================
+ Hits         5593     5648      +55     
+ Misses       2858     2808      -50     
Flag Coverage Δ
unittests 66.79% <80.00%> (+0.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/cmd_api_call.rs Outdated
patch-goblin Bot and others added 2 commits September 10, 2026 11:13
Preserve exhaustive matching for API file conversion fields

Co-authored-by: Patch Goblin <patch-goblin@users.noreply.github.com>
@jtran
jtran marked this pull request as ready for review September 10, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zoo kcl bounding-box --format is ignored (always a table); export/snapshot/view/api-call status --format are also dead

1 participant